package com.ljh.controller;

import com.ljh.feign.MenuFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/menu")
public class IndexController {
    @Autowired
    private MenuFeign menuFeign;
    @RequestMapping("/redirect/{index}")
    public String index(@PathVariable("index") String index){
        return "index";
    }
    @RequestMapping("/prepareSave")
    public String prepareSave(Model model){
        model.addAttribute("list",menuFeign.findTypes());
        return "menu_add";
    }
}
